<template>
	<view class="padding-top-sm padding-left-sm padding-bottom-sm">
		<view class=" flex justify-between">
			<view class="w-40 relative">
				<view class="bg-10"></view>
				<view class="absolute left0 top0 w-100 h-100 overflow-hidden">
					<image class="w-100 h-100 radius" mode="aspectFill" :src="md.cover"></image>
					<text v-if="md.distance" class="bg-blue text-white padding-xs round-right absolute top0 left0 text-sm">{{md.distance}}</text>
				</view>
				
			</view>
			<view class="w-60  flex flex-direction justify-between">
				<view class="flex justify-start align-baseline padding-left-sm">
					<text class="text-cut text-lg text-bold padding-xs">{{md.sname}}</text>
				</view>
				<view class="flex justify-start align-baseline padding-left-sm">
					<text v-if="md.ly" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-peitaosheshixiaotubiao_linyu"></text>
					</text>
					<text v-if="md.kt" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-kongtiao"></text>
					</text>
					<text v-if="md.gys" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-ziyuan"></text>
					</text>
					<text v-if="md.cs" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-weishengjian text-xxl"></text>
					</text>
					<text v-if="md.wifi" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-wifi"></text>
					</text>
					<text v-if="astore.yys" class="text-lg text-main bg-g-main padding-xs radius margin-right-xs ">
						<text class="iconfont icon-yinyongshui "></text>
					</text>
				</view>
				<view class="text-lg text-gray flex align-baseline padding-left-sm">
					<text class="iconfont icon-weizhi"></text>
					<text class="text-sm">{{md.address}}</text>
				</view>
				<view class="text-gray text-sm flex justify-between align-center">
					<view class="padding-left-sm">
						<button @tap="toDetail(md.storeid)" class="cu-btn sm bg-blue">详细</button>
						<button v-if="showE" @tap="toEdit(md.storeid)" class="cu-btn sm bg-blue margin-left-xs">编辑</button>
					</view>
					<text class="bg-blue padding-xs round-left">{{md.roomsize}}个房间</text>
				</view>
				
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		props: {
			md: {
				type: Object,
				default: {}
			},
			showE: {
				type: Boolean,
				default: false
			},
			path: {
				type: String,
				default: ""
			}
		},
		data: function() {
			return {
				
			};
		},
		methods: {
			toDetail: function(mdid) {
				uni.navigateTo({
					url: this.path+'/mdxx?storeid='+mdid
				});
			},
			toEdit: function(mdid) {
				uni.navigateTo({
					url: this.path+'/edit?storeid='+mdid
				});
			},
		}
	}
</script>

<style scoped>
	.kctitle {
		position: absolute;
		bottom: 0;
		width: 100%;
		display: flex;
		align-items: start;
		min-height: 100rpx;
		justify-content: space-between;
		flex-direction: column;
	}

</style>